{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "suspended-testimony",
   "metadata": {},
   "outputs": [
    {
     "ename": "ImportError",
     "evalue": "/lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /root/.pyenv/versions/3.7.0/lib/python3.7/site-packages/gmtrade/csdk/libgmtrade.so)",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mImportError\u001b[0m                               Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-1-7dad9152a11c>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m      1\u001b[0m \u001b[0;31m# 本示例运行于python3.6及以上版本\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 2\u001b[0;31m \u001b[0;32mfrom\u001b[0m \u001b[0mgmtrade\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mapi\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;32m~/.pyenv/versions/3.7.0/lib/python3.7/site-packages/gmtrade/api/__init__.py\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[1;32m      6\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m      7\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0mgmtrade\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__version__\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0m__version__\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 8\u001b[0;31m \u001b[0;32mfrom\u001b[0m \u001b[0mgmtrade\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcsdk\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mc_sdk\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mpy_gmi_set_version\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m      9\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0mgmtrade\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpb\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0maccount_pb2\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0mAccountStatus\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mExecRpt\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mOrder\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m     10\u001b[0m \u001b[0;32mfrom\u001b[0m \u001b[0mgmtrade\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0menum\u001b[0m \u001b[0;32mimport\u001b[0m \u001b[0;34m*\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mImportError\u001b[0m: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by /root/.pyenv/versions/3.7.0/lib/python3.7/site-packages/gmtrade/csdk/libgmtrade.so)"
     ]
    }
   ],
   "source": [
    "# 本示例运行于python3.6及以上版本\n",
    "from gmtrade.api import *\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "infrared-python",
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "# token身份认证\n",
    "set_token(\"498dc75ecf07987f3ac6b364c1412e04645c5bef\")\n",
    "\n",
    "# 示例中为掘金官方仿真服务地址；如API接入掘金终端，则填空字符串\n",
    "set_endpoint(\"api.myquant.cn:9000\")\n",
    "\n",
    "# 登录账户，account_id为账户ID，必填；account_alias为账号别名，选填\n",
    "a1 = account(account_id='1001', account_alias='')\n",
    "# 可login多个账户，如login(a1, a2, a3)\n",
    "login(a1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "pretty-projector",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "(null): can't open file 'version': [Errno 2] No such file or directory\r\n"
     ]
    }
   ],
   "source": [
    "!python version\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "invalid-woman",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "neural-mailing",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
